home *** CD-ROM | disk | FTP | other *** search
- ! File: BOX/Shift.Brownian
-
- ! Uses a random walk to displace columns or rows by a defined offset
-
- LIBRARY "IFFgl" ! True BASIC for Silicon Graphics
- !LIBRARY ":LIB/IFF*",":LIB/Amiga*"
-
- CALL IFFload(":IMAGES/Demo.Pic2",xmax,ymax,cmax)
- BOX KEEP 0,xmax,ymax,0 in screen$
-
- CALL ColWalk(0,xmax,ymax,0,1,2)
- GET POINT: x,y
- BOX SHOW screen$ at 0,ymax
- CALL RowWalk(0,xmax,ymax,0,1,2)
- GET POINT: x,y
- BOX SHOW screen$ at 0,ymax
- CALL ColWalk(0,xmax,ymax,0,1,2)
- CALL RowWalk(0,xmax,ymax,0,1,2)
- get point x,y
- END
-
- SUB ColWalk(lft,rgt,bas,top,colwid,yinc)
- RANDOMIZE
- LET drift= 0
- FOR x= lft to rgt step colwid
- LET drift= drift + (round(rnd)*2-1)*yinc ! Drift + or -
- BOX KEEP x,x+colwid-1,bas,top in col$ ! Fetch column
- BOX SHOW col$ at x,bas+drift ! Replace with drift
- NEXT x
- END SUB
-
- SUB RowWalk(lft,rgt,bas,top,rowhgt,xinc)
- RANDOMIZE
- LET drift= 0
- FOR y= top to bas step rowhgt
- LET drift= drift + (round(rnd)*2-1)*xinc ! Drift + or -
- BOX KEEP lft,rgt,y+rowhgt-1,y in row$ ! Fetch row
- BOX SHOW row$ at lft+drift,y ! Replace with drift
- NEXT y
- END SUB
-
-
-